/*
 * Copyright (c) 1994-2022, The FreeBSD Documentation Project
 * Copyright (c) 2021-2022, Sergio Carlavilla <carlavilla@FreeBSD.org>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

header {
  position: sticky;
  top: 0;
  z-index: 9999;
  padding: .5rem 1rem;
  background-color: var(--header-background);
}

.header-container {
  display: flex;
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

.logo-menu-bars-container {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

header nav {
  margin-left: 0;
  margin-right: 0;
}

header ul {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

header ul li {
  list-style: none;
}

.menu-bars {
  display: none;
  margin-left: auto;
  color: var(--white);
  cursor: pointer;
}

input[type='checkbox'] {
  display: none;
}

.menu {
  display: flex;
  padding: 0;
  margin: 0;
}

.menu-item {
  display: flex;
  margin-right: 1rem;
  align-items: center;
  color: var(--white) !important;
  margin-top: 0px !important;
}

.menu-item a {
  padding: 1rem 0;
  color: inherit;
}

.menu-item a,
.donate a {
  text-decoration: none;
  font-weight: 600;
}

.menu-item a:hover,
.donate a:hover {
  text-decoration: none;
}

.donate a {
  color: var(--black) !important;
}

.menu-item i {
  margin-left: .1rem;
}

.sub-menu {
  visibility: hidden;
  position: absolute;
  top: 55px;
  padding: 1rem .75rem;
  min-width: 250px;
  background-color: var(--white);
  border-radius: .4rem;
  color: #444;
  border: 1px solid #CDCDCD;
  z-index: 999;
}

.sub-menu:hover {
  visibility: visible;
}

.menu-item a:hover+.sub-menu {
  visibility: visible;
}

.sub-menu li {
  margin-top: 0;
  padding: .75rem .6rem;
}

.sub-menu .title {
  border-bottom: 1px solid #E5E7EB;
}

.sub-menu li a {
  font-weight: normal !important;
}

.sub-menu .title a {
  font-weight: bolder !important;
}

.search-donate-container {
  display: flex;
  align-items: center;
  margin-top: 0px;
  margin-left: auto;
}

.search {
  display: flex;
  border-radius: .4rem;
  background-color: var(--white);
  border: 1px solid var(--white);
  margin-top: 0px;
}

.search input[type='text'] {
  display: inline-block;
  width: 100%;
  padding: .3rem .8rem;
  border: none;
  border-radius: .4rem;
  appearance: none;
  outline: none;
  background-color: var(--white);
  color: var(--black);
}

.search button {
  background-color: var(--white);
  border: none;
  border-radius: .4rem;
}

.search button i {
  color: var(--black);
}

.donate {
  margin-left: .5rem;
}

.donate a {
  display: inline-block;
  padding: .5rem 1rem;
  background-color: var(--white);
  border-radius: .4rem;
}

.donate a .heart,
.heart .heart {
  font-size: 1.2rem;
  color: #E38582;
}

.donate:hover a .heart,
.heart:hover .heart {
  color: #D1332E;
}

@media screen and (max-width: 1100px) {
  .header-container {
    flex-direction: column;
  }

  .logo-menu-bars-container {
    width: 100%;
    padding: .5rem 0;
  }

  nav {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .menu-bars {
    display: block;
  }

  .menu {
    display: none;
    width: 100%;
  }

  #menu-bars:checked~nav .menu {
    display: block !important;
  }

  .menu-item {
    flex-direction: column;
    width: 100%;
    margin-right: 0px;
    border-top: 1px solid var(--white);
    cursor: pointer;
  }

  .menu-item a {
    width: 100%;
  }

  .menu-item a:hover+.sub-menu {
    visibility: visible;
  }

  .menu-item-description {
    display: flex;
    width: 100%;
    cursor: pointer;
  }

  .menu-item-description i {
    margin-left: auto;
  }

  .sub-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0px;
    position: static;
    visibility: visible;
    border: none;
    background-color: inherit;
    color: inherit;
    box-shadow: inherit;
  }

  .sub-menu .title {
    display: none;
    border-bottom: none;
  }

  .sub-menu li {
    padding-left: 0px;
    padding-right: 0px;
  }

  #about:checked~.sub-menu,
  #download:checked~.sub-menu,
  #documentation:checked~.sub-menu,
  #community:checked~.sub-menu {
    display: flex;
  }

  .search-donate-container {
    display: none;
  }

  .search {
    width: 100%;
  }

  #menu-bars:checked~.search-donate-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-left: unset;
    padding-top: .2rem;
  }

  .donate {
    display: flex;
    width: 100%;
    margin-left: unset;
    padding-top: .8rem;
  }

  .donate a {
    width: 100%;
    text-align: center;
  }

  .donate a .heart {
    font-size: 1.2rem;
    color: #D1332E;
  }
}

@media screen and (min-width: 900px) {
  header {
    padding: .5rem 2rem;
  }
}

@media screen and (min-width: 1451px) {
  header {
    padding: .5rem 5rem;
  }
}
